#pragma once

class DBWriter
{
private:
	void Connect (System::Data::SqlClient::SqlCommand ^);
	void Read (System::Data::SqlClient::SqlCommand ^, int *);
	array<System::Byte> ^ConvertDoubleArrayToByteArray(double *, int);
	array<System::Byte> ^ConvertDoubleArrayToByte4Array(double *, int);
	void InsertClusterLabels(System::Int32 ^, double *, int *);
public:
	DBWriter ();

	int InsertNewFlight(char* FlightName, char* PlaneName, char* StartDateTime, char* StopDateTime, int* PlaneId);
	void RegisterVectors (int , int, int);
	void SaveClusters (int *, int, char *, int, char *, char *, double **, double *, int);
	void SaveClusters (int *, int, char *, int, char *, char *, double **, double *, int, double *, int);
	void UpdateClusters (int *, int, int, char *, double **, double *, int);
	void UpdateClusters (int *, int, int, char *, double **, double *, int, double *, int);
	int SaveMetricRealization (char *, char *, double *, int, char *);
	int SaveMetricRealization (char *, char *, double *, int, double *, int, char *);
	int UpdateMetricRealization (int, double *, int);
	int UpdateMetricRealization (int, double *, int, double *, int);
	int SaveMetric (int, int, double *, char *, int);
	void SaveXMLBlank (int, int, char *);
};

